package com.sanjiahantang.youjiaclient.module.store.views.impl;

import android.text.TextUtils;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;

import com.sanjiahantang.uilibrary.adapter.listview.QuickAdapter;
import com.sanjiahantang.youjiaclient.R;
import com.sanjiahantang.youjiaclient.base.BaseMvpActivity;
import com.sanjiahantang.youjiaclient.module.store.preseneters.StoreDesignerPresenter;
import com.sanjiahantang.youjiaclient.module.store.preseneters.StoreDetailPresenter;
import com.sanjiahantang.youjiaclient.module.store.views.StoreDesignerView;
import com.sanjiahantang.youjiaclient.module.store.views.StoreDetailView;

/**
 * Created by yan on 2018/1/4.
 */

public class DesignerListActivity extends BaseMvpActivity<StoreDesignerView, StoreDesignerPresenter> implements StoreDesignerView,
        View.OnClickListener, StoreDesignerView.InitDataListener, StoreDesignerView.OnLoadListener {
    private ListView listView;

    @Override
    public void showProgress() {
        super.showProgress($this);
    }

    @Override
    public StoreDesignerPresenter initPresenter() {
        return new StoreDesignerPresenter();
    }

    @Override
    public void initView() {
        setContentView(R.layout.activity_common_list);
        TextView title = (TextView) findViewById(R.id.title);
        listView = (ListView) findViewById(R.id.listView);
        findViewById(R.id.fl_Left).setOnClickListener(this);
        title.setText("设计师列表");
        presenter.initListView(this, this);
    }

    @Override
    public void initData() {
        String roldID = this.getIntent().getStringExtra(KEY_ROLEID);
        if (!TextUtils.isEmpty(roldID)) {
            presenter.loadDataDesignerList(this, roldID, this);
        }
    }


    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.fl_Left:
                finish();
                break;
            default:
                break;
        }
    }


    @Override
    public void initListViewAdapter(QuickAdapter adapter) {
        listView.setAdapter(adapter);
    }

    @Override
    public void onLoad(Object content) {

    }
}
